package com.pks.datacenter.entity.basic;

import lombok.Data;
import lombok.EqualsAndHashCode;

import com.pks.util.coder.database.DBField;
import com.pks.util.coder.database.DBQuery;
import com.pks.util.coder.database.DBTable;
import com.pks.web.mybatis.entity.BasicEntity;

/**
 * 
 * @author pks
 * @version 2019年9月10日 
 */
@Data
@EqualsAndHashCode(callSuper = true)
@DBTable(tags = "任务配置信息" )
public class JobInfo extends BasicEntity {

	private static final long serialVersionUID = 6277485667621808868L;
	
	/** 数据处理类型，覆盖 */
	public static final int type_cover = 1;
	/** 数据处理类型，追加 */
	public static final int type_add = 2;
	
	/** 开启状态 */
	public static final int state_on = 1;
	/** 关闭状态 */
	public static final int state_off = 0;

	@DBQuery(value = {"=" , "like"})
	@DBField(name = "name" , comment = "任务名称" , length = 100)
	private String name ;			//任务命名
	
	@DBField(name = "exec_time" , comment = "任务启动时间节点 采用quartz cron时间设置方式")
	private String exec_time;		//任务启动时间节点 quartz时间设置方式
	
	@DBQuery
	@DBField(name = "type" , comment = "数据处理方式 1-清空覆盖 2-追加数据" , length = 4)
	private Integer type;			//数据处理方式 

	@DBField(name = "state" , comment = "状态 1-开启  0-暂停" ,length = 4)
	@DBQuery
	private Integer state ;			//状态  1、开启  0、未开启
	
	@DBQuery
	@DBField(name = "db_source" , comment = "来源数据源")
	private Long db_source;			//数据来源

	@DBQuery
	@DBField(name = "db_target" , comment = "目标数据源")
	private Long db_target;			//数据转移目标
	
	private String show_db_source;
	private String show_db_target;

	@Override
	public void insertBefore() {
		super.insertBefore();
		state = state_off ;
	}
	
}
